package com.gang.mars.asm.classvisitor;


import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;

/**
 * @Author：gang.chen
 * @Date：2023/8/22 14:36
 *
 * 调用顺序场景一
 * visit
 * [visitSource] [visitModule] [visitNestHost] [visitPermittedSubclass] [visitSOuterClass]
 * (
 *  visitAnnotation |
 *  visitTypeAnnotation |
 *  visitAttribute
 * )*
 * (
 *  visitNestMember |
 *  visitInnerClass |
 *  visitRecordComponent |
 *  visitField |
 *  visitMethod
 * )*
 * visitEnd
 *
 * 调用顺序场景二
 * visit
 * (
 *  visitField |
 *  visitMethod
 * )*
 * visitEnd
 */
public class GangClassVisitor extends ClassVisitor {

    public GangClassVisitor(int api) {
        super(api);
    }

    public GangClassVisitor(int api, ClassVisitor classVisitor) {
        super(api, classVisitor);
    }

    /**
     * @param signature 处理泛型， 需要给定值，反之设计为 null
     *
     * [] 表示最多调用一次，可以不调用，即使是 最多调用一次
     *
     * */
    @Override
    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
        super.visit(version, access, name, signature, superName, interfaces);
    }

    @Override
    public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) {
        return super.visitField(access, name, descriptor, signature, value);
    }

    @Override
    public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
        return super.visitMethod(access, name, descriptor, signature, exceptions);
    }

    @Override
    public void visitEnd() {
        super.visitEnd();
    }


}
